using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Microsoft.CommerceServer.SecureSite
{
	/// <summary>
	/// Summary description for Wizard.
	/// </summary>
	public class Wizard : System.Windows.Forms.Form
	{
        private System.Windows.Forms.Panel panel1;
		protected System.Windows.Forms.Button btnNext;
		protected System.Windows.Forms.Button btnPrevious;
		private System.Windows.Forms.Panel panel2;

        protected ErrorProvider MasterErrorProvider;
        private Label lblTitle;
        private Header header1;
        private IContainer components;

		public Wizard()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Wizard));
            this.btnNext = new System.Windows.Forms.Button();
            this.btnPrevious = new System.Windows.Forms.Button();
            this.panel1 = new System.Windows.Forms.Panel();
            this.lblTitle = new System.Windows.Forms.Label();
            this.panel2 = new System.Windows.Forms.Panel();
            this.MasterErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
            this.header1 = new Microsoft.CommerceServer.SecureSite.Header();
            this.panel1.SuspendLayout();
            this.panel2.SuspendLayout();
            ((System.ComponentModel.ISupportInitialize)(this.MasterErrorProvider)).BeginInit();
            this.SuspendLayout();
            // 
            // btnNext
            // 
            this.btnNext.Location = new System.Drawing.Point(448, 8);
            this.btnNext.Name = "btnNext";
            this.btnNext.Size = new System.Drawing.Size(88, 23);
            this.btnNext.TabIndex = 0;
            this.btnNext.Text = "Next";
            this.btnNext.Click += new System.EventHandler(this.btnNext_Click);
            // 
            // btnPrevious
            // 
            this.btnPrevious.Location = new System.Drawing.Point(344, 8);
            this.btnPrevious.Name = "btnPrevious";
            this.btnPrevious.Size = new System.Drawing.Size(88, 23);
            this.btnPrevious.TabIndex = 1;
            this.btnPrevious.Text = "Previous";
            this.btnPrevious.Click += new System.EventHandler(this.btnPrevious_Click);
            // 
            // panel1
            // 
            this.panel1.Controls.Add(this.lblTitle);
            this.panel1.Controls.Add(this.header1);
            this.panel1.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel1.Location = new System.Drawing.Point(0, 0);
            this.panel1.Name = "panel1";
            this.panel1.Size = new System.Drawing.Size(546, 91);
            this.panel1.TabIndex = 2;
            // 
            // lblTitle
            // 
            this.lblTitle.AutoSize = true;
            this.lblTitle.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.lblTitle.Location = new System.Drawing.Point(12, 53);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new System.Drawing.Size(79, 29);
            this.lblTitle.TabIndex = 4;
            this.lblTitle.Text = "label1";
            // 
            // panel2
            // 
            this.panel2.Controls.Add(this.btnNext);
            this.panel2.Controls.Add(this.btnPrevious);
            this.panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
            this.panel2.Location = new System.Drawing.Point(0, 339);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(546, 40);
            this.panel2.TabIndex = 3;
            // 
            // MasterErrorProvider
            // 
            this.MasterErrorProvider.ContainerControl = this;
            // 
            // header1
            // 
            this.header1.BackColor = System.Drawing.Color.White;
            this.header1.Dock = System.Windows.Forms.DockStyle.Top;
            this.header1.Location = new System.Drawing.Point(0, 0);
            this.header1.Name = "header1";
            this.header1.Size = new System.Drawing.Size(546, 50);
            this.header1.TabIndex = 0;
            // 
            // Wizard
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(546, 379);
            this.Controls.Add(this.panel2);
            this.Controls.Add(this.panel1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MaximizeBox = false;
            this.Name = "Wizard";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Secure Commerce Server 2007";
            this.TopMost = true;
            this.Closed += new System.EventHandler(this.Wizard_Closed);
            this.Load += new System.EventHandler(this.Wizard_Load);
            this.panel1.ResumeLayout(false);
            this.panel1.PerformLayout();
            this.panel2.ResumeLayout(false);
            ((System.ComponentModel.ISupportInitialize)(this.MasterErrorProvider)).EndInit();
            this.ResumeLayout(false);

		}
		#endregion

		protected virtual void btnNext_Click(object sender, System.EventArgs e)
		{
			//
		}

		protected virtual void btnPrevious_Click(object sender, System.EventArgs e)
		{
			//
		}

		private void Wizard_Load(object sender, System.EventArgs e)
		{
		
		}

		private void Wizard_Closed(object sender, System.EventArgs e)
		{
			CommerceSecurityInfo.CloseAll();
		}

		public bool IsValid
		{
			get
			{
				foreach (Control control1 in base.Controls)
				{
					if (this.MasterErrorProvider.GetError(control1) != string.Empty)
					{
						return false;
					}
					if(control1.GetType().Name == "Panel")
					{
						foreach(Control control2 in control1.Controls)
						{
							if (this.MasterErrorProvider.GetError(control2) != string.Empty)
							{
								return false;
							}
							if (control2.GetType().Name=="GroupBox")
							{
								foreach(Control control3 in control2.Controls)
								{
									if (this.MasterErrorProvider.GetError(control3) != string.Empty)
									{
										return false;
									}
								}
							}
						}
					}
				}
				return true;
			}
		}
 
		protected string Title
		{
			get
			{
				return this.lblTitle.Text;
			}
			set
			{
				this.lblTitle.Text = value;
			}
		}
	}
}
